﻿@{
    var gridPageSize = 4;
}
<table class="adminContent">
    <tr>
        <td>
            <div id="search-term-report-grid"></div>

            <script>
                    $(document).ready(function () {
                        $("#search-term-report-grid").kendoGrid({
                            dataSource: {
                                type: "json",
                                transport: {
                                    read: {
                                        url: "@Html.Raw(Url.Action("PopularSearchTermsReport", "Common"))",
                                        type: "POST",
                                        dataType: "json"
                                    }
                                },
                                schema: {
                                    data: "Data",
                                    total: "Total",
                                    errors: "Errors"
                                },
                                error: function(e) {
                                    display_kendoui_grid_error(e);
                                    // Cancel the changes
                                    this.cancelChanges();
                                },
                                pageSize: @(gridPageSize),
                                serverPaging: true,
                                serverFiltering: true,
                                serverSorting: true
                            },
                            pageable: {
                                refresh: true
                            },
                            editable: {
                                confirmation: false,
                                mode: "inline"
                            },
                            scrollable: false,
                            columns: [{
                                field: "Keyword",
                                title: "@T("Admin.SearchTermReport.Keyword")"
                            }, {
                                field: "Count",
                                title: "@T("Admin.SearchTermReport.Count")"
                            }]
                        });
                    });
            </script>
        </td>
    </tr>
</table>
